<!--
 * @Author: wangming
 * @Date: 2021-08-19 10:21:19
 * @LastEditors: wangming
 * @LastEditTime: 2021-10-08 17:16:22
 * @FilePath: /hanma-application-designer-fed/src/pages/app/qrcode/index.vue
 * @Description: 
-->
<route>
{
  "meta":{
    "title":"App设置",
    "localism": "sys.app_setting"
  }
}
</route>
<template>
  <div class="pt100">
    <div class="ks-row-around tc">
      <div>
        <img :src="appurl" :alt="$t('sys.app_download')" />
        <div>{{$t('sys.app_download')}}</div>
      </div>
      <div>
        <img :src="serveurl" :alt="$t('sys.app_application_service_configuration')" />
        <div>{{$t('sys.app_application_service_configuration')}}</div>
      </div>
    </div>
  </div>
</template>
<script>
import QRCODE from "qrcode";
import { getBasePath } from "@/config/api.config";
import { getApppedestalPublished } from '@/apis/paas/HmAppPedestalController.js'
import { baseURL } from "@/config/api.config";
export default {
  data() {
    return {
      appurl: "",
      serveurl: "",
    };
  },
  async created() {
    //server
    let appSetveCode = `${baseURL}/api/app-config/server-config`;
    this.serveurl = await QRCODE.toDataURL(appSetveCode);
    //apk
    let apkInfo = await getApppedestalPublished();
    const Apkpath = getBasePath(apkInfo.filePath);
    this.appurl = await QRCODE.toDataURL(Apkpath);
  },
  methods: {},
};
</script>
<style scoped lang="scss">
img {
  width: 300px;
}
</style>
